#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
int Ordered_Check(int* arr,int num)
{
	int i = 0;
	int count = 0;
	for (i = 0; i < num-1 ; i++)
	{
		if (arr[i] <= arr[i + 1])
		{
			count += 1;
		}
	}
	if (count == num - 1)
	{
		return 1;
	}
	else
	{
		count = 0;
	}
	for (i = 0; i < num - 1; i++)
	{
		if (arr[i] >= arr[i + 1])
		{
			count += 1;
		}
	}
	if (count == num - 1)
	{
		return 1;
	}
	return 0;
}
int main()
{
	int num = 0;
	int arr[20] = { 0 };
	scanf("%d", &num);
	for (int i = 0; i < num; i++)
	{
		scanf("%d", &arr[i]);
	}
	int ret = Ordered_Check(arr,num);
	if (!ret)
	{
		printf("Unsorted!");
	}
	else
	{
		printf("Sorted!");
	}
	return 0;
}